home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Other View Systems / MacApp Views / FWMAObjs.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  11.4 KB  |  371 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWMAObjs.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWMAOBJS_H
  11. #define FWMAOBJS_H
  12.  
  13. #ifndef FWVIEW_H
  14. #include "FWView.h"
  15. #endif
  16.  
  17. #ifndef FWCONTRL_H
  18. #include "FWContrl.h"
  19. #endif
  20.  
  21. #ifndef FWBUTTON_H
  22. #include "FWButton.h"
  23. #endif
  24.  
  25. #ifndef FWMAREAD_H
  26. #include "FWMARead.h"
  27. #endif
  28.  
  29. //========================================================================================
  30. // MacApp types
  31. //========================================================================================
  32. struct VPoint
  33. {
  34.     long v;
  35.     long h;
  36. };
  37. struct VRect
  38. {
  39.     long top;
  40.     long left;
  41.     long bottom;
  42.     long right;
  43. };
  44.  
  45. //========================================================================================
  46. // Forward declarations
  47. //========================================================================================
  48.  
  49. class FW_CReadableStream;
  50. class FW_CSuperView;
  51. class FW_CScrollBarScroller;
  52. class FW_MReceiver;
  53. struct Environment;
  54.  
  55. //========================================================================================
  56. // class FW_CMAObject
  57. //========================================================================================
  58.  
  59. class FW_CMAObject
  60. {
  61. public:
  62.     FW_CMAObject(ResType type);
  63.     
  64.     virtual void     ReadFrom(Environment* ev, FW_CReadableStream& stream, 
  65.                             FW_CSuperView* superview, FW_MReceiver* receiver);
  66. public:
  67.     ResType    fClassID;
  68.     long    fEndOfObject;
  69. };
  70.  
  71. //========================================================================================
  72. // class FW_CMABehavior
  73. //========================================================================================
  74.  
  75. class FW_CMABehavior : public FW_CMAObject
  76. {
  77. public:
  78.     FW_CMABehavior(ResType type);
  79.     
  80.     virtual void         ReadFrom(Environment* ev, FW_CReadableStream& stream, 
  81.                                 FW_CSuperView* superview, FW_MReceiver* receiver);
  82.  
  83. };
  84.  
  85. //========================================================================================
  86. // class FW_CMADialogBehavior
  87. //========================================================================================
  88.  
  89. class FW_CMADialogBehavior : public FW_CMABehavior
  90. {
  91. public:
  92.     FW_CMADialogBehavior(ResType type);
  93.     
  94.     virtual void             ReadFrom(Environment* ev, FW_CReadableStream& stream, 
  95.                                 FW_CSuperView* superview, FW_MReceiver* receiver);    
  96.     static FW_CMAObject*    Create(ResType type);
  97. };
  98.  
  99. //========================================================================================
  100. // class FW_CMAEventHandler
  101. //========================================================================================
  102.  
  103. class FW_CMAEventHandler : public FW_CMAObject
  104. {
  105. public:
  106.     FW_CMAEventHandler(ResType type);
  107.     
  108.     virtual void         ReadFrom(Environment* ev, FW_CReadableStream& stream, 
  109.                                 FW_CSuperView* superview, FW_MReceiver* receiver);
  110.  
  111.     ResType                fIdentifier;    // view id
  112.     Boolean                fEnabled;        // not used by ODF for now
  113. };
  114.  
  115. //========================================================================================
  116. // class FW_CMAView
  117. //========================================================================================
  118.  
  119. class FW_CMAView : public FW_CMAEventHandler
  120. {
  121. public:
  122.     FW_CMAView(ResType type);
  123.     
  124.     static FW_CMAObject*    Create(ResType type);
  125.     virtual void             ReadFrom(Environment* ev, FW_CReadableStream& stream, 
  126.                                     FW_CSuperView* superview, FW_MReceiver* receiver);
  127.     virtual void            ReadFields(Environment* ev, FW_CReadableStream& stream);
  128.     virtual FW_CView*        CreateODFView(Environment* ev, FW_CSuperView* superview, FW_MReceiver* receiver);
  129.  
  130.     void                    PostCreateODFView(Environment* ev, FW_CSuperView* superview);
  131.     
  132.     FW_CRect                fBounds;
  133.     FW_CPoint                fExtent;
  134.     Boolean                    fIsContentView;
  135. //    FW_ViewBinding            fBindings;            SEE LATER
  136.     Boolean                    fVisible;
  137.     Boolean                    fWantsToBeTarget;
  138.     Boolean                    fIsScroller;        
  139. };
  140.  
  141. //========================================================================================
  142. // class FW_CMAWindow
  143. //========================================================================================
  144.  
  145. class FW_CMAWindow : public FW_CMAView
  146. {
  147. public:
  148.     FW_CMAWindow(ResType type);
  149.     
  150.     static FW_CMAObject*    Create(ResType type);
  151.     virtual void            ReadFields(Environment* ev, FW_CReadableStream& stream);
  152.     virtual FW_CView*        CreateODFView(Environment* ev, FW_CSuperView* superview, FW_MReceiver* receiver);
  153.     
  154.     short     fProcID;
  155. };
  156.  
  157. //========================================================================================
  158. // class FW_CMADialog
  159. //========================================================================================
  160.  
  161. class FW_CMADialog : public FW_CMAView
  162. {
  163. public:
  164.     FW_CMADialog(ResType type);
  165.     
  166.     static FW_CMAObject*    Create(ResType type);
  167.     virtual void            ReadFields(Environment* ev, FW_CReadableStream& stream);
  168.     virtual FW_CView*        CreateODFView(Environment* ev, FW_CSuperView* superview, FW_MReceiver* receiver);
  169. };
  170.  
  171. //========================================================================================
  172. // class FW_CMATextGridView
  173. //========================================================================================
  174. // TTextListView is the only "grid view" class supported by ODF for now.
  175. // Later we can add a FW_CMAGridView from which FW_CMATextGridView will derive
  176.  
  177. class FW_CMATextGridView : public FW_CMAView
  178. {
  179. public:
  180.     FW_CMATextGridView(ResType type);
  181.     
  182.     static FW_CMAObject*    Create(ResType type);
  183.     virtual FW_CView*        CreateODFView(Environment* ev, FW_CSuperView* superview, FW_MReceiver* receiver);
  184.     virtual void             ReadFields(Environment* ev, FW_CReadableStream& stream);
  185.  
  186.     short                    fNumOfRows;
  187.     Boolean                    fSingleSelection;
  188.     short                    fTextStyleID;
  189. };
  190.  
  191. //========================================================================================
  192. // class FW_CMAControl
  193. //========================================================================================
  194.  
  195. class FW_CMAControl : public FW_CMAView
  196. {
  197. public:
  198.     FW_CMAControl(ResType type);
  199.  
  200.     static FW_CMAObject*    Create(ResType type);
  201.     virtual FW_CView*        CreateODFView(Environment* ev, FW_CSuperView* superview, FW_MReceiver* receiver);
  202.     virtual void             ReadFields(Environment* ev, FW_CReadableStream& stream);
  203.  
  204.     short                    fTextStyleID;
  205.     long                    fEventNumber;        // MacApp event number or "choices"
  206.                                                 // is used as the ODF control message
  207. };
  208.  
  209. //========================================================================================
  210. // class FW_CMAStaticText
  211. //========================================================================================
  212.  
  213. class FW_CMAStaticText : public FW_CMAControl
  214. {
  215. public:
  216.     FW_CMAStaticText(ResType type);
  217.     
  218.     static FW_CMAObject*    Create(ResType type);
  219.     virtual FW_CView*        CreateODFView(Environment* ev, FW_CSuperView* superview, FW_MReceiver* receiver);
  220.     virtual void             ReadFields(Environment* ev, FW_CReadableStream& stream);
  221.  
  222.     Str255                    fText;
  223.     Boolean                    fAutoWrap;
  224. };
  225.  
  226. //========================================================================================
  227. // class FW_CMAEditText
  228. //========================================================================================
  229.  
  230. class FW_CMAEditText : public FW_CMAStaticText
  231. {
  232. public:
  233.     FW_CMAEditText(ResType type);
  234.     
  235.     static FW_CMAObject*    Create(ResType type);
  236.     virtual FW_CView*        CreateODFView(Environment* ev, FW_CSuperView* superview, FW_MReceiver* receiver);
  237.     virtual void             ReadFields(Environment* ev, FW_CReadableStream& stream);
  238.  
  239.     short                     fMaxChars;
  240. };
  241.  
  242. //========================================================================================
  243. // class FW_CMATEView
  244. //========================================================================================
  245.  
  246. class FW_CMATEView : public FW_CMAView
  247. {
  248. public:
  249.     FW_CMATEView(ResType type);
  250.     
  251.     static FW_CMAObject*    Create(ResType type);
  252.     virtual FW_CView*        CreateODFView(Environment* ev, FW_CSuperView* superview, FW_MReceiver* receiver);
  253.     virtual void             ReadFields(Environment* ev, FW_CReadableStream& stream);
  254.  
  255.     Boolean                    fAutoWrap;
  256.     short                     fMaxChars;
  257.     short                    fTextStyleID;
  258. };
  259.  
  260. //========================================================================================
  261. // class FW_CMACluster
  262. //========================================================================================
  263.  
  264. class FW_CMACluster : public FW_CMAControl
  265. {
  266. public:
  267.     FW_CMACluster(ResType type);
  268.     
  269.     static FW_CMAObject*    Create(ResType type);
  270.     virtual FW_CView*        CreateODFView(Environment* ev, FW_CSuperView* superview, FW_MReceiver* receiver);
  271.     virtual void             ReadFields(Environment* ev, FW_CReadableStream& stream);
  272.  
  273.     Str255                    fLabel;
  274. };
  275.  
  276. //========================================================================================
  277. // class FW_CMAButton
  278. //========================================================================================
  279.  
  280. class FW_CMAButton : public FW_CMAControl
  281. {
  282. public:
  283.     FW_CMAButton(ResType type);
  284.     
  285.     static FW_CMAObject*    Create(ResType type);
  286.     virtual FW_CView*        CreateODFView(Environment* ev, FW_CSuperView* superview, FW_MReceiver* receiver);
  287.     virtual void             ReadFields(Environment* ev, FW_CReadableStream& stream);
  288.  
  289.     FW_ButtonKind            fKind;
  290.     Str255                    fLabel;
  291.     Boolean                    fIsOn;
  292. };
  293.  
  294. //========================================================================================
  295. // class FW_CMAPopupMenu
  296. //========================================================================================
  297.  
  298. class FW_CMAPopupMenu : public FW_CMAControl
  299. {
  300. public:
  301.     FW_CMAPopupMenu(ResType type);
  302.     
  303.     static FW_CMAObject*    Create(ResType type);
  304.     virtual FW_CView*        CreateODFView(Environment* ev, FW_CSuperView* superview, FW_MReceiver* receiver);
  305.     virtual void             ReadFields(Environment* ev, FW_CReadableStream& stream);
  306.  
  307.     short                fMenuID;
  308.     short                fCurrentItem;
  309.     short                fLabelWidth;
  310.     Str255                fLabel;
  311.     Boolean                fUseAddResMenu;
  312.     ResType                fUseAddResMenuResType;
  313. };
  314.  
  315. //========================================================================================
  316. // class FW_CMAScrollBarScroller
  317. //========================================================================================
  318.  
  319. class FW_CMAScrollBarScroller : public FW_CMAView
  320. {
  321. public:
  322.     FW_CMAScrollBarScroller(ResType type);
  323.     
  324.     static FW_CMAObject*    Create(ResType type);
  325.     virtual FW_CView*        CreateODFView(Environment* ev, FW_CSuperView* superview, FW_MReceiver* receiver);
  326.     virtual void             ReadFields(Environment* ev, FW_CReadableStream& stream);
  327.  
  328.     ResType                    fVertSbID;
  329.     ResType                    fHorzSbID;
  330.     VRect                    fSBarOffsets;
  331.     Boolean                    fLiveScrolling;
  332.     
  333.     FW_CScrollBarScroller*    fODFScroller;
  334.     
  335. };
  336.  
  337. //========================================================================================
  338. // class FW_CMAPictSView
  339. //========================================================================================
  340.  
  341. class FW_CMAPictSView : public FW_CMAControl
  342. {
  343. public:
  344.     FW_CMAPictSView(ResType type);
  345.  
  346.     static FW_CMAObject*    Create(ResType type);
  347.     virtual FW_CView*        CreateODFView(Environment* ev, FW_CSuperView* superview, FW_MReceiver* receiver);
  348.     virtual void             ReadFields(Environment* ev, FW_CReadableStream& stream);
  349.     
  350.     short        fPictID;
  351. };
  352.  
  353. //========================================================================================
  354. // class FW_CMAUnknownView
  355. //========================================================================================
  356.  
  357. class FW_CMAUnknownView : public FW_CMAView
  358. {
  359. public:
  360.     FW_DECLARE_AUTO(FW_CMAUnknownView)
  361.     
  362.     FW_CMAUnknownView(ResType type, FW_CString& name);
  363.  
  364.     static FW_CMAObject*    Create(ResType type, FW_CString& name);
  365.     virtual FW_CView*        CreateODFView(Environment* ev, FW_CSuperView* superview, FW_MReceiver* receiver);
  366.  
  367.     FW_CString                fName;
  368. };
  369.  
  370. #endif
  371.